@isTest
public class TaskExtControllerTest {

    public static Task createUpdateTaskTest() {
        Lead led = new Lead(LastName = 'Test Last',FirstName = 'Test First', Company = 'Test COmp', Status = 'Open - Not Contacted', Home_Phone__c = '2345678901', University_Email__c = 'test@test.com',Country = 'Mexico');
        insert led;
        Account acc = new Account(LastName = 'Test LastName', FirstName = 'Test First', Work_Phone__c = '2345678901', Marketing_Email__pc = 'test@test.com');
        insert acc;
        
        Task ts = new Task();
        ts.Description = 'Test Task';
        ts.Priority = 'Normal';
        ts.status = 'Not Started';
        ts.Subject = 'Test Subject';
        ts.type = 'Otheer';
       // ts.whoId = led.Id;
        ts.whatId = acc.Id;
        ts.activityDate = System.Date.today().addDays(Integer.valueOf(2));
        insert ts;
        return ts;
    }
    
    @isTest
    public static void searchTasksTest() {
        Task t = TaskExtControllerTest.createUpdateTaskTest();
        ApexPages.StandardController taskSC = new ApexPages.StandardController(t);
        TaskExtController tc = new TaskExtController(taskSC);
        tc.selSearchFilter = 'Overdue';
        tc.searchTasks();
        tc.selSearchFilter = 'Today';
        tc.searchTasks();
        tc.selSearchFilter = 'Today + Overdue';
        tc.searchTasks();
        tc.selSearchFilter = 'Tomorrow';
        tc.searchTasks();
        tc.selSearchFilter = 'Next 7 Days';
        tc.searchTasks();
        tc.selSearchFilter = 'Next 7 Days + Overdue';
        tc.searchTasks();
        tc.selSearchFilter = 'This Month';
        tc.searchTasks();
    }
    
    @isTest
    public static void getSearchFilterListTest() {
        Task t = TaskExtControllerTest.createUpdateTaskTest();
        ApexPages.StandardController taskSC = new ApexPages.StandardController(t);
        TaskExtController tc = new TaskExtController(taskSC);
        tc.getSearchFilterList();
    }
    
    @isTest
    public static void newTaskTest() {
        Task t = TaskExtControllerTest.createUpdateTaskTest();
        ApexPages.StandardController taskSC = new ApexPages.StandardController(t);
        TaskExtController tc = new TaskExtController(taskSC);
        tc.newTask();
    }
}